package com.qf.day09.teampk;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.Arrays;
import java.util.Random;

public class FightableImpl implements Fightable{
    private Fightable [] team1=new FightableImpl[3];
    private Fightable [] team2=new FightableImpl[3];

    public FightableImpl() {
    }

    public FightableImpl(Fightable[] team1, Fightable[] team2) {
        this.team1 = team1;
        this.team2 = team2;
    }

    public Fightable[] getTeam1() {
        return team1;
    }

    public void setTeam1(Fightable[] team1) {
        this.team1 = team1;
    }

    public Fightable[] getTeam2() {
        return team2;
    }

    public void setTeam2(Fightable[] team2) {
        this.team2 = team2;
    }

    @Override
    public String toString() {
        return "FightableImpl{" +
                "team1=" + Arrays.toString(team1) +
                ", team2=" + Arrays.toString(team2) +
                '}';
    }

    @Override
    public int teamFight(Fightable[] team1,Fightable[] team2) {
        Random random = new Random();
        int startNum=random.nextInt(2);
        if(startNum==0){
            System.out.println("team1先开始,team2后开始");
        }else{
            System.out.println("team2先开始,team1后开始");
        }
        return startNum;
    }



    @Override
    public void isteamLive() {

    }

}
